﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FineSoft.Models
{
	public class NameSpace
	{
		public readonly string FullName;
		public string Name { get; set; }
		public NameSpace(string fullName)
		{
			this.FullName = fullName;
			this.Name = this.FullName.Substring(this.FullName.LastIndexOf('.') + 1);
		}

		public NameSpace[] NameSpaces { get; set; }

		public ComponentClass[] Components { get; set; }

		private System.Collections.Generic.IEnumerable<object> _Children;
		public System.Collections.Generic.IEnumerable<object> Children
		{
			get
			{
				if (this._Children == null)
					this._Children = this.NameSpaces.OfType<object>().Concat(this.Components);
				return this._Children;
			}
		}
	}
}